#!/bin/bash
IBUPRO=/data/project/ibuflow/project
cat << EOF
1.SELECT THIS MONTH.
2.SELECT LAST MONTH.
EOF
read -p "Plase input your choise : " choise
case $choise in
    1)
        read -t 60 -p "Order Number:" order_number
        read -p "Order Date(Default in 3 days.):" order_date
	$HOME/bin/mylog/selectlogThisMonth.sh $order_number $order_date
        for ip in "110.140.155.49" "110.140.130.49"
	do  
        if [ `id -u` -eq 0 ]; then
    	    ssh -p 52249 root@$ip $HOME/bin/mylog/selectlogThisMonth.sh $order_number $order_date
        else
    	    ssh -p 52249 mayy@$ip $HOME/bin/mylog/selectlogThisMonth.sh $order_number $order_date
        fi
	done
        ;;
    2)
        read   -t 30 -p "Order Number:" order_number
        read   -p "Select Date:" order_date
        $HOME/bin/mylog/selectlogLastMonth.sh $order_number $order_date
        for ip in "10.104.155.49" "10.104.130.49"
        do
        if [ `id -u` -eq 0 ]; then
            ssh -p 52249 root@$ip $HOME/bin/mylog/selectlogLastMonth.sh $order_number $order_date
	else
            ssh -p 52249 mayy@$ip $HOME/bin/mylog/selectlogLastMonth.sh $order_number $order_date
	fi
        done
        ;;
    *)
        echo "Your input wrong!"
        exit 1

esac
